<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%layout("/WEB-INF/view/common/inc/admin_head.html",{title:'', styles:'bootstrap,font-awesome,animate,style,bootstrap-table,layui-date,auto-complete,dtvalidate,layui,chosen'}){%>
    <style type="text/css">
        body{padding-top:10px;}
        *{margin:0;padding:0;list-style-type:none;}
        a,img{border:0;}
        .demo h2{font-size:16px;color:#3366cc;height:30px;}
        .demo li{float:left;}
        .has-no{color:#3366cc;}
        .has-success{color: #1ab394;}
        .has-warning{color: #f8ac59;}
        .has-error{color: #ed5565;}
        .has-receive{color: #9E792E;}
        .remark {
            width: 100%; /*自动适应父布局宽度*/
            overflow: auto;
            word-break: break-all;
        }
    </style>
    <%}%>
</head>

<body>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div id="toolbar" class="btn-group" style="margin-bottom:5px;">
                <button  class="layui-btn layui-btn-sm export-all-btn" style="margin-left: -2px"  >
                    <i class="layui-icon"></i>导出费用归集数据
                </button>
            </div>
            <!-- START 数据表格 -->
            <table id="portTable"
                   data-toolbar="#toolbar"
                   data-side-pagination="server"
                   data-pagination="true"
                   data-resizable="true"
                   data-url="/sea/finance/vtFeeMatch/feeMatch.do"
                   data-page-size="15"
                   class="table table-striped table-hover"
            >
            </table>
        </div>
    </div>
    <!-- END 数据表格 -->
</div>


<%layout("/WEB-INF/view/common/inc/admin_js.html",{modules:'jquery,bootstrap,bootstrap-table,dtvalidate,dtvalidate-lang-zh_cn,bootstrap-table-zh-CN,laydate,layer,chosen,chosen-demo,layui,upload'}){}%>
<script>

    var $portTable = $('#portTable');
    $(function(){
        //START 表格配置
        $portTable.bootstrapTable({
            columns: [

                {
                    title: '费用归集V2数据',
                    field: 'feeName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '费用归集',
                    field: 'feeType',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    field: 'operate',
                    title: '操作',
                    align: 'center',
                    valign: 'middle',
                    formatter: optFormatter
                }
            ],
            onLoadSuccess : function(){
                $('.export-btn').on('click',function(){
                    var feeName = $(this).attr('data-val');
                    layer.confirm('是否要导出源数据【'+feeName+'】？', {
                        btn: ['确定','取消'],title:'提示'
                    }, function(){
                        layer.closeAll();
                        layer.load();
                        window.location.href='/sea/finance/vtFeeMatch/exportByFeeName.do?feeName='+feeName;
                        layer.closeAll();
                    });
                });
            }
        });
        //操作菜单
    });

    function optFormatter(value,row){
        var content= '';
        if( null != row.feeType && row.feeType !='') {

        }else{
            content += '&nbsp;<button class="export-btn btn btn-xs btn-success" data-val="' + row.feeName + '" title="导出源数据"><i class="fa fa-download"></i> 导出源数据</button>';
        }
        return content;
    }

    $(".export-all-btn").click(function () {
        layer.confirm('是否要导出所有源数据？', {
            btn: ['确定','取消'],title:'提示'
        }, function(){
            layer.closeAll();
            layer.load();
            window.location.href='/sea/finance/vtFeeMatch/exportAllByFeeName.do';
            layer.closeAll();
        });
    });

</script>
</body>
</html>
